//**************************************************************************************************************
// CLASS: InstrTypeR
//
// DESCRIPTION
// Declares a class that represents a type R instruction, i.e., one that has just one operand: a register. This
// class is derived from Instr.
//
// AUTHOR INFORMATION
// Group 2
// Tyler Williams
// Lauren Walker
// Cameron Stewart
// Fatimah Alowah
//**************************************************************************************************************
// Preprocessor guard.
#ifndef INSTRTYPER_HPP
#define INSTRTYPER_HPP

#include <string>
#include "Instr.hpp"
#include "Register.hpp"

//==============================================================================================================
// CLASS: InstrTypeR (derived from Instr)
//==============================================================================================================
// Write the class declaration
class InstrTypeR : public Instr {

public:
    //==========================================================================================================
    // PUBLIC FUNCTION MEMBERS:
    //==========================================================================================================

    //----------------------------------------------------------------------------------------------------------
    // Default ctor.
    //----------------------------------------------------------------------------------------------------------
    InstrTypeR
        (
        );

    //----------------------------------------------------------------------------------------------------------
    // Constructor. A type R instruction has a mnemonic and a branch target register.
    //----------------------------------------------------------------------------------------------------------
    InstrTypeR
        (
        std::string const& pMnemonic,
        Register const& pRegister
        );

    //----------------------------------------------------------------------------------------------------------
    // Copy ctor.
    //----------------------------------------------------------------------------------------------------------
    InstrTypeR
        (
        InstrTypeR const& pInstr
        );

    //----------------------------------------------------------------------------------------------------------
    // Virtual dtor.
    //----------------------------------------------------------------------------------------------------------
    virtual ~InstrTypeR
        (
        );

    //----------------------------------------------------------------------------------------------------------
    // Encode()
    //----------------------------------------------------------------------------------------------------------
    virtual void Encode
        (
        );

    //----------------------------------------------------------------------------------------------------------
    // GetRegister()
    //----------------------------------------------------------------------------------------------------------
    Register GetRegister
        (
        )
        const;

    //----------------------------------------------------------------------------------------------------------
    // operator=()
    //----------------------------------------------------------------------------------------------------------
    InstrTypeR& operator=
        (
        InstrTypeR const& pInstr
        );

protected:
    //==========================================================================================================
    // PROTECTED UNCTION MEMBERS:
    //==========================================================================================================

    //----------------------------------------------------------------------------------------------------------
    // Copy()
    //----------------------------------------------------------------------------------------------------------
    void Copy
        (
        InstrTypeR const& pInstr
        );

    //----------------------------------------------------------------------------------------------------------
    // SetRegister()
    //----------------------------------------------------------------------------------------------------------
    void SetRegister
        (
        Register const& pRegister
        );

private:
    //==========================================================================================================
    // PRIVATE DATA MEMBERS:
    //==========================================================================================================
    Register mRegister;
};


// End preprocessor guard.
#endif
